package com.pzb.wechat.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pzb.wechat.mapper.WechatAddressMapper;
import com.pzb.wechat.domain.WechatAddress;
import com.pzb.wechat.service.IWechatAddressService;

/**
 * 收货地址Service业务层处理
 * 
 * @author Mr_Wu
 * @date 2022-01-21
 */
@Service
public class WechatAddressServiceImpl implements IWechatAddressService 
{
    @Autowired
    private WechatAddressMapper wechatAddressMapper;

    /**
     * 查询收货地址
     * 
     * @param id 收货地址主键
     * @return 收货地址
     */
    @Override
    public WechatAddress selectWechatAddressById(Long id)
    {
        return wechatAddressMapper.selectWechatAddressById(id);
    }

    /**
     * 查询收货地址列表
     * 
     * @param
     * @return 收货地址
     */
    @Override
    public List<WechatAddress> selectWechatAddressList(String openid, String extAppid)
    {
        return wechatAddressMapper.selectWechatAddressList(openid,extAppid);
    }

    /**
     * 新增收货地址
     * 
     * @param wechatAddress 收货地址
     * @return 结果
     */
    @Override
    public int insertWechatAddress(WechatAddress wechatAddress)
    {
        return wechatAddressMapper.insertWechatAddress(wechatAddress);
    }

    /**
     * 修改收货地址
     * 
     * @param wechatAddress 收货地址
     * @return 结果
     */
    @Override
    public int updateWechatAddress(WechatAddress wechatAddress)
    {
        return wechatAddressMapper.updateWechatAddress(wechatAddress);
    }

    /**
     * 批量删除收货地址
     * 
     * @param ids 需要删除的收货地址主键
     * @return 结果
     */
    @Override
    public int deleteWechatAddressByIds(Long[] ids)
    {
        return wechatAddressMapper.deleteWechatAddressByIds(ids);
    }

    /**
     * 删除收货地址信息
     * 
     * @param id 收货地址主键
     * @return 结果
     */
    @Override
    public int deleteWechatAddressById(Long id)
    {
        return wechatAddressMapper.deleteWechatAddressById(id);
    }

    @Override
    public Long selectAddressDefaultId(String openid, String extAppid) {
        return wechatAddressMapper.selectAddressDefaultId(openid,extAppid);
    }

    @Override
    public int setAddressIsNotDefault(String openid, String extAppid) {
        return wechatAddressMapper.setAddressIsNotDefault(openid,extAppid);
    }

    @Override
    public int setAddressDefault(Long id) {
        return wechatAddressMapper.setAddressDefault(id);
    }

    @Override
    public WechatAddress selectWechatDefaultAddress(String openid, String extAppid) {
        return wechatAddressMapper.selectWechatDefaultAddress(openid,extAppid);
    }
}
